package org.akaza.openclinica.domain.datamap;
//default package
//Generated Jul 31, 2013 2:03:33 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.akaza.openclinica.domain.DataMapDomainObject;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
* VersioningMap generated by hbm2java
*/
@Entity
@Table(name = "versioning_map")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class VersioningMap extends DataMapDomainObject  {

	private VersioningMapId versionMapId;
	private CrfVersion crfVersion;
	private Item item;

	public VersioningMap() {
	}

	public VersioningMap(VersioningMapId id) {
		this.versionMapId = id;
	}

	public VersioningMap(VersioningMapId id, CrfVersion crfVersion, Item item) {
		this.versionMapId = id;
		this.crfVersion = crfVersion;
		this.item = item;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "crfVersionId", column = @Column(name = "crf_version_id")),
			@AttributeOverride(name = "itemId", column = @Column(name = "item_id")) })
	public VersioningMapId getVersionMapId() {
		return this.versionMapId;
	}

	public void setVersionMapId(VersioningMapId id) {
		this.versionMapId = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "crf_version_id", insertable = false, updatable = false)
	public CrfVersion getCrfVersion() {
		return this.crfVersion;
	}

	public void setCrfVersion(CrfVersion crfVersion) {
		this.crfVersion = crfVersion;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "item_id", insertable = false, updatable = false)
	public Item getItem() {
		return this.item;
	}

	public void setItem(Item item) {
		this.item = item;
	}



}
